package com.tcat.user.mapper;

import com.tcat.user.pojo.Users;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

public interface UserMapper extends Mapper<Users> {
    @Insert("INSERT INTO tb_urs(uid,rid) VALUES (#{uid},#{rid})")
    int insertUrs(@Param("uid")Long uid, @Param("rid") Long rid);

    /**
     * 根据uid删除中间表相关数据
     * @param uid
     */
    @Delete("DELETE FROM tb_urs WHERE uid=#{uid}")
    void deleteByUsersInUrs(@Param("uid") Long uid);
}
